//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.lyq.bean.mySql;

import com.lyq.bean.JudgeSort;
import java.sql.Connection;
import java.sql.PreparedStatement;

public class UpdatepwdSql {
    public UpdatepwdSql() {
    }

    public String updatesql(String usersort, String username, String pwd) {
        (new MysqlLinking()).getLink();
        Connection conn = MysqlLinking.conn;
        if (conn != null) {
            JudgeSort js = new JudgeSort(usersort);
            String TableName = js.getTableName();
            String name = js.getUname();
            String password = js.getPwd();

            try {
                String sql = "update " + TableName + " set " + password + "=? where " + name + "=?";
                PreparedStatement ps = conn.prepareStatement(sql);
                ps.setString(1, pwd);
                ps.setString(2, username);
                int count = ps.executeUpdate();
                if (count >= 0) {
                    return "ture";
                }
            } catch (Exception var12) {
                Exception e = var12;
                e.printStackTrace();
            }
        } else {
            System.out.println("数据库连接错误！");
        }

        return null;
    }
}
